package com.sskj.mine;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sskj.lib.base.BaseActivity;
import com.sskj.lib.bean.UserData;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @author Hey
 * Create at  2019/05/01
 */
public class PersonActivity extends BaseActivity<PersonPresenter> {


    @BindView(R2.id.tvTitle)
    TextView tvTitle;
    @BindView(R2.id.ivBack)
    LinearLayout ivBack;
    @BindView(R2.id.right_tv)
    TextView rightTv;
    @BindView(R2.id.mobile_tv)
    TextView mobileTv;
    @BindView(R2.id.transition_id_tv)
    TextView transitionIdTv;
    @BindView(R2.id.name_tv)
    TextView nameTv;
    @BindView(R2.id.id_card_tv)
    TextView idCardTv;

    @Override
    public int getLayoutId() {
        return R.layout.mine_activity_person;
    }

    @Override
    public PersonPresenter getPresenter() {
        return new PersonPresenter();
    }

    @Override
    public void initView() {
        setTitle(getString(R.string.mine_personActivity1));
    }

    @Override
    public void initData() {
mPresenter.getUserInfo();
    }

    public static void start(Context context) {
        Intent intent = new Intent(context, PersonActivity.class);
        context.startActivity(intent);
    }

    public void updateUserTitle(UserData userData) {
        mobileTv.setText(TextUtils.isEmpty(userData.getMobile()) ? "----" : userData.getMobile());
        transitionIdTv.setText(userData.getAccount());
        nameTv.setText(TextUtils.isEmpty(userData.getRealname()) ? "----" : userData.getRealname());
        idCardTv.setText(TextUtils.isEmpty(userData.getIdcard()) ? "----" : userData.getIdcard());
    }

}
